<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            margin: 40px 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #inp{
            width:277px;
            height: 40px;
            outline: none;
            box-sizing: border-box;
        }
        .btn{
            margin-left: 10px;
            display: inline-block;
            height: 40px;
            width:100px;
            text-align: center;
            line-height: 40px;
            background: #409EFF;
            color: #fff;
        }
    </style>
</head>
<body>
    <div class="box">
        <input type="text" id="inp"  /><span class="btn">搜索</span>
    </div>
    <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
    <script>
        $('#inp').click(function(){
            var equi_name = $('#inp').val()
            if(!equi_name){
                return false
            }
            $.ajax({
                url:'/api/shop/get_purchase_traffic',
                data:{equi_name:equi_name},
                type:'POST',
                dataType:"json",
                success:function(res){
                    console.log(res,'res')
                }
            })
        })
        
    </script>
</body>
</html>